package com.ccl.iot.object;
public class IOTAuthInfo {
	public long iID;
	public long iAuthObject;
	public int iAuthState;
	
	public IOTAuthInfo(){
	}
	
	public IOTAuthInfo(long aID, long aAuthObject, int aAuthState){
		iID = aID;
		iAuthObject = aAuthObject;
		iAuthState = aAuthState;
	}
	
	public IOTAuthInfo(IOTAuthInfo aInfo){
		if (aInfo != null){
			iID = aInfo.iID;
			iAuthObject = aInfo.iAuthObject;
			iAuthState = aInfo.iAuthState;
		}
	}
	
	public IOTAuthInfo clone() {
		return new IOTAuthInfo(this);
	}
	
	@Override
	public String toString() {
		return iID + ":" + iAuthObject + "-" + (char)iAuthState;
	}

	@Override
	public boolean equals(Object o) {
		if (super.equals(o) == false){
			if (o != null && o instanceof IOTAuthInfo){
				IOTAuthInfo tInfo = (IOTAuthInfo) o;
				
				return tInfo.iID == iID && tInfo.iAuthObject == iAuthObject && tInfo.iAuthState == iAuthState;
			}
			
			return false;
		}else{
			return true;
		}
	}
	
	
}
